Type checker#527
Conversation
64a9f0a to
9ef2f45
Compare
dario-coscia
left a comment
There was a problem hiding this comment.
To me looks good the structure, I am only wondering if we should merge it as it is or making it draft, update all files where we want type checking and then merge
I share this doubt with you. As it is, this decorator is nice but cannot be used immediately, as we do not have any type suggestions in PINA. I see the following options:
Of course, the second is an option only if the decorator is faster than hard coded checks, which I think might not be the case. The first one requires a lot of work, but I would be happy to contribute. Let me know what you think about it, @dario-coscia! |
|
I
The type checker only checks types, but the Line <line> of file <file> ===> Entered in function <function name>, with input <input name> and input type <input type>
===> Entered in ....
===> Entered in ....
Line <line> of file <file> ===> Entered in function <function name>, with input <input name> and input type <input type>
===> Entered in .... This way, it is by default turned off, but when debugging is enabled, it does the following. We can start thinking about adding it to the solver and see where it is also needed. Let's also listen to @ndem0 and @FilippoOlivo for this |
a84b105 to
a2b6c1f
Compare
|
Maybe also related to #551 ? @GiovanniCanali what do you think? |
9ef2f45 to
eb4e6b0
Compare
Yes, definitively! |
eb4e6b0 to
d058c5a
Compare
* Fix adaptive refinement (#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (#581) * Fix tutorial .html link (#580) * fix problem data collection for v0.1 (#584) * Message Passing Module (#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
* Fix adaptive refinement (mathLab#571) --------- Co-authored-by: Dario Coscia <93731561+dario-coscia@users.noreply.github.com> * Remove collector * Fixes * Fixes * rm unnecessary comment * fix advection (mathLab#581) * Fix tutorial .html link (mathLab#580) * fix problem data collection for v0.1 (mathLab#584) * Message Passing Module (mathLab#516) * add deep tensor network block * add interaction network block * add radial field network block * add schnet block * add equivariant network block * fix + tests + doc files * fix egnn + equivariance/invariance tests Co-authored-by: Dario Coscia <dariocos99@gmail.com> --------- Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it> * add type checker (mathLab#527) --------- Co-authored-by: Filippo Olivo <filippo@filippoolivo.com> Co-authored-by: Giovanni Canali <115086358+GiovanniCanali@users.noreply.github.com> Co-authored-by: giovanni <giovanni.canali98@yahoo.it> Co-authored-by: AleDinve <giuseppealessio.d@student.unisi.it>
Fixes #440: add a type checker to be used for debugging.
If the debugging level is set to
DEBUG, theenforce_typedecorator will enforce the type hints both for the decorated function's arguments and return value.It requires type hints in the decorated function.
Example: